/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package boundaries;

import javax.enterprise.context.RequestScoped;
import javax.faces.context.FacesContext;
import javax.inject.Named;

/**
 *
 * @author Alberto, Alessandra
 */
@Named
@RequestScoped
public class SearchFieldBean {
    
    private String username;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
    
    public SearchFieldBean () {
        
    }
    
    public String search () {
        FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("search", username);
        return "search?faces-redirect=true";
    }
    
}
